ifndef cc
cc = gcc
endif
objects = list.o test.o listfifostack.o
cflags = $(CFLAGS) -Wall -g

test: test.c list.h shared
	$(cc) $(cflags) -o test -llistfifostack -L. test.c

%.o: %.c list.h
	$(cc) $(cflags) -fPIC -c $<

.PHONY:shared clean
shared: $(objects)
	make $(objects)
	$(cc) $(cflags) -shared -o liblistfifostack.so list.o listfifostack.o
#$(cc) $(cflags) -shared -o liblistfifostack.so $(filter-out test.o, $(objects))

staticEXE: $(objects)
	$(cc) $(cflags) -o test $(objects)

clean:
	rm -f *.o test liblistfifostack.so
